From bb2fc00e1f399be919d7b777dd0ae17edd6b2a2e Mon Sep 17 00:00:00 2001
From: trisusilo48 <tri.susilo@altama.co.id>
Date: Fri, 25 Oct 2024 10:04:34 +0700
Subject: sitemap categories brand

---
 src/pages/shop/find/[slug].jsx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'src/pages/shop/find/[slug].jsx')

diff --git a/src/pages/shop/find/[slug].jsx b/src/pages/shop/find/[slug].jsx
index 50797153..85e780ff 100644
--- a/src/pages/shop/find/[slug].jsx
+++ b/src/pages/shop/find/[slug].jsx
@@ -16,11 +16,12 @@ const ProductSearch = dynamic(() =>
 const BASE_URL = 'https://indoteknik.com';
 export default function FindPage() {
   const route = useRouter();
+  const qSlug = route?.query?.slug || null;
   const url = BASE_URL + route.asPath;
   const [result, setResult] = useState(null);
   const [query, setQuery] = useState(null);
 
-  const slug = getNameFromSlug( route.query.slug) +' '+ getIdFromSlug( route.query.slug)
+  const slug = qSlug ? getNameFromSlug(route?.query?.slug) +' '+ getIdFromSlug(route?.query?.slug) : '';
   const getUrls = async (url) => {
     try {
       let response = await axios(
-- 
cgit v1.2.3

